<?php

namespace app\api\controller;

use app\api\model\Banner;
use app\api\model\Guide;
use app\api\model\Page;
use app\common\controller\Api;

/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 引导页管理
     */
    public function guide()
    {
        $Guide = new Guide();
        $list=$Guide->order('weigh asc')->select();
        $this->success('请求成功',$list);
    }

    /**
     * 轮播图管理
     * @return void
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function banner()
    {
        $Banner = new Banner();
        $list=$Banner->order('weigh asc')->select();
        $this->success('请求成功',$list);
    }

    /**
     * 单页管理
     * @return void
     */
    public function page()
    {
        $param = $this->request->param();
        $Page = new Page();
        $find= $Page->where('id', $param['id'])->find();
        $this->success('',$find);
    }
}
